
package com.shangsi.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.shangsi.blockhandler.MyBlockHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dzd
 * @date 2021-12-18
 */
@RestController
public class RateLimitController {

    @RequestMapping("byUrl")
    @SentinelResource(value = "byUrl",blockHandlerClass = MyBlockHandler.class,blockHandler = "handle1")
    public String byUrl(){
        return "byUrl 正常返回1";
    }

    @RequestMapping("byUrl2")
    @SentinelResource(value = "byUrl2",blockHandlerClass = MyBlockHandler.class,blockHandler = "handle2" )
    public String byUrl2(){
        return "byUrl2 正常返回2";
    }
}
